package org.rpc.serializer;

import java.io.IOException;

/**
 * Created by rico on 2018/2/28.
 */
public interface Serializer {

    /**
     * @param obj
     * @return
     * @throws IOException
     */
    byte[] serialize(Object obj) throws IOException;

    /**
     * @param bytes
     * @param clz
     * @param <T>
     * @return
     * @throws IOException
     */
    <T> T deserialize(byte[] bytes, Class<T> clz) throws IOException;
}
